package pers.ree.demo.concurrent.atomic;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerDemo {

    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(3);
        int i1 = atomicInteger.incrementAndGet();
        System.out.println(i1);

        int i2 = atomicInteger.getAndAdd(2);
        System.out.println(i2);

        System.out.println(atomicInteger.incrementAndGet());
    }
}
